package com.framework.boc.admin.pay.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class DateTimeUtils {

    private static final DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");

    /**
     * 格式化日期
     * @param dateTime  传入时间
     * @param pattern   时间格式
     * @return
     */
    public static String formatTime(LocalDateTime dateTime, String pattern) {
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(pattern);
        String formatDate = dateTimeFormatter.format(dateTime);
        return formatDate;
    }


}
